<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <p>您购买的图书有：</p>
    <div class="container">

    </div>
    <script>
        const str = JSON.parse(localStorage.getItem('str'))
        const container = document.querySelector('.container')
        container.innerHTML = str.map(item => {
            return `<div>${item}</div>`
        }).join('')
    </script>
</body>

</html>